import request from '@/utils/request'

/**
 * 字段配置列表
 * @param typeCode
 */
export function fetchFieldCfgList(params?: any) {
  return request({
    url: '/zgyp-system/api/v1/field/list',
    method: 'post',
    data: params,
  })
}

export function addFieldCfg(data: any) {
  return request({
    url: '/zgyp-system/api/v1/field/add',
    method: 'post',
    data,
  })
}

export function updateFieldCfg(data: any) {
  return request({
    url: '/zgyp-system/api/v1/field/modify',
    method: 'put',
    data,
  })
}

export function fetchFieldCfgDetail(id: number) {
  return request({
    url: `/zgyp-system/api/v1/field/detail?id=${id}`,
    method: 'get',
  })
}

export function deleteFieldCfg(data: any) {
  return request({
    url: '/zgyp-system/api/v1/field/delete',
    method: 'delete',
    data,
  })
}
